private void executeScript(Dictionary<String, String> scriptDefinition) throws Exception {
String script = scriptDefinition.get(SCRIPT_KEY);
if (script == null) {
throw new IllegalArgumentException("Script definition *must* define at least a 'script' property!");
}
CommandSession session = m_processor.createSession(System.in, System.out, System.err);
try {
Object scriptResult = session.execute(script);
m_logger.log(LogService.LOG_DEBUG, "Script output:
" + scriptResult);
}
finally {
session.close();
}
}
|